<template>
  <div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :hide-on-single-page="value"
      :page-sizes="[10, 20, 30]"
      :page-size="10"
      layout="total, sizes, prev, pager, next"
      :total="total"
    ></el-pagination>
  </div>
</template>

<script>
export default {
  name: "pagination",
  props: ["total"],
  methods: {
    handleSizeChange(val) {
      this.$emit("getSizeData", val);
    },
    handleCurrentChange(val) {
      this.$emit("getCurrentData", val);
    }
  },
  data() {
    return {
      value: false
    };
  }
};
</script>

<style>
.block {
  margin-top: 20px;
}
</style>